// Package sysin
// @Link  https://github.com/bufanyun/hotgo
// @Copyright  Copyright (c) 2025 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License  https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.15.11
package sysin

import (
	"context"
	"github.com/gogf/gf/v2/encoding/gjson"
	"github.com/shopspring/decimal"
	"hotgo/internal/consts"
	"hotgo/internal/model/entity"
	"hotgo/internal/model/input/form"
	"hotgo/utility/validate"

	"github.com/gogf/gf/v2/errors/gerror"
	"github.com/gogf/gf/v2/frame/g"
	"github.com/gogf/gf/v2/os/gtime"
)

// UserOrderUpdateFields 修改订单中心字段过滤
type UserOrderUpdateFields struct {
	Uid                string      `json:"uid"            dc:"订单UUID"`
	TraceId            string      `json:"traceId"        dc:"交易ID"`
	PayMethod          string      `json:"payMethod"      dc:"支付方式"`
	Status             string      `json:"status"         dc:"订单状态"`
	UserId             int64       `json:"userId"         dc:"用户ID"`
	StoreId            int64       `json:"storeId"        dc:"商家ID"`
	OrderType          string      `json:"orderType"      dc:"订单类型"`
	ProductId          int64       `json:"productId"      dc:"商品ID"`
	ProductNewID       int64       `json:"productNewId"   dc:"新人商品ID"`
	MemberCardId       int64       `json:"memberCardId"   dc:"会员卡ID"`
	Qty                int         `json:"qty"            dc:"购买数量"`
	UsePoints          float64     `json:"usePoints"      dc:"使用积分"`
	UseAmount          float64     `json:"useAmount"      dc:"使用金额(RMB)"`
	ExpressInfoID      int64       `json:"expressInfoId"  dc:"物流信息 0为不需要"`
	PayTime            *gtime.Time `json:"payTime"        dc:"付款时间"`
	ConfirmTime        *gtime.Time `json:"confirmTime"    dc:"订单确认时间"`
	EndTime            *gtime.Time `json:"endTime"        dc:"结束时间"`
	ArchiveTime        *gtime.Time `json:"archiveTime"    dc:"归档时间"`
	Recipient          string      `json:"recipient"           dc:"收件人"`
	ShippingProvinceId int64       `json:"shippingProvinceId"  dc:"省市区id"`
	ShippingAddress    string      `json:"shippingAddress"     dc:"详细地址"`
	Tel                string      `json:"tel"                 dc:"联系方式"`
	Deleted            string      `json:"deleted"       dc:"是否删除:0-否,1-是"`
	CostPrice          float64     `json:"costPrice"          dc:"成本价"`
}

// UserOrderInsertFields 新增订单中心字段过滤
type UserOrderInsertFields struct {
	Uid       string `json:"uid"            dc:"订单UUID"`
	TraceId   string `json:"traceId"        dc:"交易ID"`
	PayMethod string `json:"payMethod"      dc:"支付方式"`
	Status    string `json:"status"         dc:"订单状态"`
	UserId    int64  `json:"userId"         dc:"用户ID"`
	//StoreId            int64       `json:"storeId"        dc:"商家ID"`
	OrderType          string      `json:"orderType"      dc:"订单类型"`
	ProductId          int64       `json:"productId"      dc:"商品ID"`
	ProductNewID       int64       `json:"productNewId"   dc:"新人商品ID"`
	MemberCardId       int64       `json:"memberCardId"   dc:"会员卡ID"`
	Qty                int         `json:"qty"            dc:"购买数量"`
	UsePoints          float64     `json:"usePoints"      dc:"使用积分"`
	UseAmount          float64     `json:"useAmount"      dc:"使用金额(RMB)"`
	PayTime            *gtime.Time `json:"payTime"        dc:"付款时间"`
	ConfirmTime        *gtime.Time `json:"confirmTime"    dc:"订单确认时间"`
	EndTime            *gtime.Time `json:"endTime"        dc:"结束时间"`
	ArchiveTime        *gtime.Time `json:"archiveTime"    dc:"归档时间"`
	Recipient          string      `json:"recipient"           dc:"收件人"`
	ShippingProvinceId int64       `json:"shippingProvinceId"  dc:"省市区id"`
	ShippingAddress    string      `json:"shippingAddress"     dc:"详细地址"`
	Tel                string      `json:"tel"                 dc:"联系方式"`
	StoreId            int64       `json:"storeId"            dc:"下单门店ID (单门店下单时设置，多门店不设置)"`
	BusinessId         int64       `json:"businessId"         dc:"下单商户ID (下单时门店有关联商户设置)"`
	CostPrice          float64     `json:"costPrice"          dc:"成本价"`
	ReceiverAddressId  int64       `json:"receiverAddressId"  dc:"收货地址ID"`
	RealName           string      `json:"realName"           dc:"真实姓名"`
	IdCard             string      `json:"idCard"             dc:"身份证号"`
	ShareMemberId      int64       `json:"shareMemberId"      dc:"分享用户 id"`
}

// UserOrderEditInp 修改/新增订单中心
type UserOrderEditInp struct {
	entity.Order
}

func (in *UserOrderEditInp) Filter(ctx context.Context) (err error) {
	// 验证订单UUID
	if err := g.Validator().Rules("required").Data(in.Uid).Messages("订单UUID不能为空").Run(ctx); err != nil {
		return err.Current()
	}

	// 验证支付方式
	if err := g.Validator().Rules("required").Data(in.PayMethod).Messages("支付方式不能为空").Run(ctx); err != nil {
		return err.Current()
	}

	// 验证订单状态
	if err := g.Validator().Rules("required").Data(in.Status).Messages("订单状态不能为空").Run(ctx); err != nil {
		return err.Current()
	}

	// 验证用户ID
	if err := g.Validator().Rules("required").Data(in.UserId).Messages("用户ID不能为空").Run(ctx); err != nil {
		return err.Current()
	}

	// 验证商家ID
	//if err := g.Validator().Rules("required").Data(in.StoreId).Messages("商家ID不能为空").Run(ctx); err != nil {
	//	return err.Current()
	//}

	// 验证订单类型
	if err := g.Validator().Rules("required").Data(in.OrderType).Messages("订单类型不能为空").Run(ctx); err != nil {
		return err.Current()
	}

	// 验证商品ID
	if err := g.Validator().Rules("required").Data(in.ProductId).Messages("商品ID不能为空").Run(ctx); err != nil {
		return err.Current()
	}

	// 验证购买数量
	if err := g.Validator().Rules("required").Data(in.Qty).Messages("购买数量不能为空").Run(ctx); err != nil {
		return err.Current()
	}

	// 验证使用积分
	if err := g.Validator().Rules("required").Data(in.UsePoints).Messages("使用积分不能为空").Run(ctx); err != nil {
		return err.Current()
	}

	// 验证使用金额(RMB)
	if err := g.Validator().Rules("regex:(^[0-9]{1,10}$)|(^[0-9]{1,10}[\\.]{1}[0-9]{1,2}$)").Data(in.UseAmount).Messages("使用金额(RMB)最多允许输入10位整数及2位小数").Run(ctx); err != nil {
		return err.Current()
	}

	return
}

type UserOrderEditModel struct{}

// UserOrderDeleteInp 删除订单中心
type UserOrderDeleteInp struct {
	Id interface{} `json:"id" v:"required#id不能为空" dc:"id"`
}

func (in *UserOrderDeleteInp) Filter(ctx context.Context) (err error) {
	return
}

type UserOrderDeleteModel struct{}

// UserOrderViewInp 获取指定订单中心信息
type UserOrderViewInp struct {
	Id int64 `json:"id" v:"required#id不能为空" dc:"id"`
}

func (in *UserOrderViewInp) Filter(ctx context.Context) (err error) {
	return
}

type UserOrderViewModel struct {
	Id                        int64       `json:"id"            dc:"id"`
	Uid                       string      `json:"uid"           dc:"订单UUID，积分权益为PR-开头 (PR-123456789000) 积分电商为PE-开头 (PE-123456789000) 团购订单为GO-开头 (GO-123456789000) 会员订单为MV-开头 (MV-123456789000)"`
	TraceId                   string      `json:"traceId"       dc:"交易ID(流水号)"`
	UserId                    int64       `json:"userId"        dc:"用户ID"`
	StoreId                   int64       `json:"storeId"       dc:"商家ID"`
	ShareMemberId             int64       `json:"shareMemberId" dc:"分享人ID"`
	OrderType                 string      `json:"orderType"     dc:"订单类型"`
	ProductId                 int64       `json:"productId"     dc:"商品ID"`
	Qty                       uint        `json:"qty"           dc:"购买数量"`
	PayMethod                 string      `json:"payMethod"     dc:"支付方式"`
	UsePoints                 float64     `json:"usePoints"     dc:"使用积分"`
	UseAmount                 float64     `json:"useAmount"     dc:"使用金额(RMB)"`
	Status                    string      `json:"status"        dc:"订单状态"`
	ExpressInfoId             int64       `json:"expressInfoId" dc:"物流信息 0为不需要"`
	CreatedAt                 *gtime.Time `json:"createdAt"     dc:"创建时间"`
	UpdatedAt                 *gtime.Time `json:"updatedAt"     dc:"更新时间"`
	PayTime                   *gtime.Time `json:"payTime"       dc:"付款时间"`
	ConfirmTime               *gtime.Time `json:"confirmTime"   dc:"订单确认时间"`
	EndTime                   *gtime.Time `json:"endTime"       dc:"结束时间(物流为发货时间,核销为核销时间)"`
	ArchiveTime               *gtime.Time `json:"archiveTime"   dc:"归档时间"`
	Recipient                 string      `json:"recipient"          dc:"收件人"`
	ShippingProvinceId        int64       `json:"shippingProvinceId" dc:"省市区id"`
	ShippingAddress           string      `json:"shippingAddress"    dc:"详细地址"`
	Tel                       string      `json:"tel"                dc:"联系方式"`
	AdminMemberRealName       string      `json:"adminMemberRealName"       dc:"真实姓名"`
	AdminMemberUsername       string      `json:"adminMemberUsername"       dc:"帐号"`
	AdminMemberMobile         string      `json:"adminMemberMobile"         dc:"手机号码"`
	ProductName               string      `json:"productName"               dc:"商品名称"`
	ProductMainImage          *gjson.Json `json:"productMainImage"          dc:"商品主图"`
	StoreName                 string      `json:"storeName"                 dc:"门店名称"`
	ExpressInfoStatus         int         `json:"expressInfoStatus"         dc:"状态 0:未发货 1:发货"`
	ExpressInfoExpressCompany int         `json:"expressInfoExpressCompany" dc:"快递公司"`
	ExpressInfoExpressNumber  string      `json:"expressInfoExpressNumber"  dc:"快递单号"`
	ExpressInfoOperatorId     int64       `json:"expressInfoOperatorId"     dc:"操作发货人"`
	ExpressInfoDispatchTime   *gtime.Time `json:"expressInfoDispatchTime"   dc:"发货时间"`
	RefundReason              string      `json:"refund_reason"                    dc:"退款原因"`
	ProductNewId              int64       `json:"productNewId"       dc:"新人商品ID"`
	MemberCardId              int64       `json:"memberCardId"       dc:"会员卡ID"`
	VerifiedCount             uint        `json:"verified_count"     dc:"已核销次数"`
	CostPrice                 float64     `json:"cost_price"         dc:"成本价"`
	ReceiverAddressId         int64       `json:"receiverAddressId"  dc:"收货地址ID"`
}

// UserOrderListInp 获取订单中心列表
type UserOrderListInp struct {
	form.PageReq
	Uid               string        `json:"uid"               dc:"订单UUID"`
	UserID            int64         `json:"userId"            dc:"用户ID"`
	TraceId           string        `json:"traceId"           dc:"交易ID"`
	Status            string        `json:"status"            dc:"订单状态"`
	StatusNum         int           `json:"statusNum"         dc:"订单状态-编号(1:待支付,5:已过期,11:待使用,4:已结束)"`
	StoreId           int64         `json:"storeId"           dc:"商家ID"`
	OrderType         string        `json:"orderType"         dc:"订单类型"`
	OrderStatus       string        `json:"orderStatus"       dc:"订单状态"`
	ProductId         int64         `json:"productId"         dc:"商品ID"`
	CreatedAt         []*gtime.Time `json:"createdAt"         dc:"创建时间"`
	ArchiveTime       []*gtime.Time `json:"archiveTime"       dc:"归档时间"`
	AdminMemberMobile string        `json:"adminMemberMobile" dc:"手机号码"`
}

func (in *UserOrderListInp) Filter(ctx context.Context) (err error) {
	return
}

// StoreApiUserOrderListInp 获取订单中心列表
type StoreApiUserOrderListInp struct {
	form.PageReq
	Uid               string        `json:"uid"               dc:"订单UUID"`
	UserID            int64         `json:"userId"            dc:"用户ID"`
	TraceId           string        `json:"traceId"           dc:"交易ID"`
	Status            string        `json:"status"            dc:"订单状态"`
	StatusNum         int           `json:"statusNum"         dc:"订单状态-编号(1:待支付,5:已过期,11:待使用,4:已结束)"`
	OrderType         string        `json:"orderType"         dc:"订单类型"`
	ProductId         int64         `json:"productId"         dc:"商品ID"`
	CreatedAt         []*gtime.Time `json:"createdAt"         dc:"创建时间"`
	ArchiveTime       []*gtime.Time `json:"archiveTime"       dc:"归档时间"`
	AdminMemberMobile string        `json:"adminMemberMobile" dc:"手机号码"`
}

type UserOrderListModel struct {
	Id             int64       `json:"id"                  dc:"id"`
	Uid            string      `json:"uid"                 dc:"订单UUID"`
	TraceId        string      `json:"traceId"             dc:"交易ID"`
	PayMethod      string      `json:"payMethod"           dc:"支付方式"`
	Status         string      `json:"status"              dc:"订单状态(待支付=待付款;已过期=已关闭;待使用=待核销;已结束=已完成)"`
	OrderType      string      `json:"orderType"           dc:"订单类型"`
	Qty            int         `json:"qty"                 dc:"购买数量"`
	UsePoints      float64     `json:"usePoints"           dc:"使用积分"`
	UseAmount      float64     `json:"useAmount"           dc:"使用金额(RMB)"`
	ExpressCompany string      `json:"expressCompany"      dc:"物流公司"`
	CreatedAt      *gtime.Time `json:"createdAt"           dc:"创建时间"`
	EndTime        *gtime.Time `json:"endTime"             dc:"结束时间(物流为发货时间,核销为核销时间)"`
	PayTime        *gtime.Time `json:"payTime"             dc:"付款时间(未付款时为订单关闭时间)"`
	UserID         int64       `json:"userId"              dc:"用户ID"`
	ExpressInfoId  int64       `json:"expressInfoId"  dc:"物流信息 0为不需要"`
	//ExpressInfoExpressCompany int         `json:"expressInfoExpressCompany"     dc:"快递公司"`
	ExpressInfoExpressNumber string      `json:"expressInfoExpressNumber"      dc:"快递单号"`
	AdminMemberRealName      string      `json:"adminMemberRealName" dc:"真实姓名"`
	AdminMemberUsername      string      `json:"adminMemberUsername" dc:"帐号"`
	AdminMemberNickname      string      `json:"adminMemberNickname" dc:"昵称"`
	AdminMemberMobile        string      `json:"adminMemberMobile"   dc:"手机号码"`
	ProductName              string      `json:"productName"         dc:"商品名称"`
	ProductMainImage         *gjson.Json `json:"productMainImage"    dc:"商品主图"`
	StoreName                string      `json:"storeName"           dc:"门店名称"`
	MemberCardId             int64       `json:"memberCardId"        dc:"会员卡ID(1:月卡，2:季卡，3:年卡)"`
	MemberCardName           string      `json:"memberCardName"          description:"名称"`
	MemberCardImgUrl         string      `json:"memberCardImgUrl"        description:"图片"`
}

// UserOrderExportModel 导出订单中心
type UserOrderExportModel struct {
	Id                        int64       `json:"id"                        dc:"id"`
	Uid                       string      `json:"uid"                       dc:"订单UUID"`
	TraceId                   string      `json:"traceId"                   dc:"交易ID"`
	PayMethod                 string      `json:"payMethod"                 dc:"支付方式"`
	Status                    string      `json:"status"                    dc:"订单状态"`
	UserId                    int64       `json:"userId"                    dc:"用户ID"`
	StoreId                   int64       `json:"storeId"                   dc:"商家ID"`
	OrderType                 string      `json:"orderType"                 dc:"订单类型"`
	ProductId                 int64       `json:"productId"                 dc:"商品ID"`
	Qty                       int         `json:"qty"                       dc:"购买数量"`
	UsePoints                 float64     `json:"usePoints"                 dc:"使用积分"`
	UseAmount                 float64     `json:"useAmount"                 dc:"使用金额(RMB)"`
	ExpressCompany            string      `json:"expressCompany"            dc:"物流公司"`
	ExpressId                 string      `json:"expressId"                 dc:"快递单号"`
	CreatedAt                 *gtime.Time `json:"createdAt"                 dc:"创建时间"`
	UpdatedAt                 *gtime.Time `json:"updatedAt"                 dc:"更新时间"`
	PayTime                   *gtime.Time `json:"payTime"                   dc:"付款时间"`
	ConfirmTime               *gtime.Time `json:"confirmTime"               dc:"订单确认时间"`
	EndTime                   *gtime.Time `json:"endTime"                   dc:"结束时间"`
	ArchiveTime               *gtime.Time `json:"archiveTime"               dc:"归档时间"`
	AdminMemberRealName       string      `json:"adminMemberRealName"       dc:"真实姓名"`
	AdminMemberUsername       string      `json:"adminMemberUsername"       dc:"帐号"`
	AdminMemberMobile         string      `json:"adminMemberMobile"         dc:"手机号码"`
	ProductName               string      `json:"productName"               dc:"商品名称"`
	ProductMainImage          *gjson.Json `json:"productMainImage"          dc:"商品主图"`
	StoreName                 string      `json:"storeName"                 dc:"门店名称"`
	ExpressInfoStatus         int         `json:"expressInfoStatus"         dc:"状态 0:未发货 1:发货"`
	ExpressInfoExpressCompany int         `json:"expressInfoExpressCompany" dc:"快递公司"`
	ExpressInfoExpressNumber  string      `json:"expressInfoExpressNumber"  dc:"快递单号"`
	ExpressInfoOperatorId     int64       `json:"expressInfoOperatorId"     dc:"操作发货人"`
	ExpressInfoDispatchTime   *gtime.Time `json:"expressInfoDispatchTime"   dc:"发货时间"`
}

// UserOrderStatusInp 更新订单中心状态
type UserOrderStatusInp struct {
	Id     int64 `json:"id" v:"required#id不能为空" dc:"id"`
	Status int   `json:"status" dc:"状态:1-取消，2-删除，3-确认收货"`
}

func (in *UserOrderStatusInp) Filter(ctx context.Context) (err error) {
	if in.Id <= 0 {
		err = gerror.New("id不能为空")
		return
	}

	if in.Status <= 0 {
		err = gerror.New("状态不能为空")
		return
	}

	if !validate.InSlice(consts.StatusSlice, in.Status) {
		err = gerror.New("状态不正确")
		return
	}
	return
}

type UserOrderStatusModel struct{}

type OrderPayInp struct {
	//StoreID            int64  `json:"storeId" v:"required#商家ID不能为空" dc:"商家ID"` // 一个商品可能对应多个商家id
	ShareMemberId      int64  `json:"shareMemberId" dc:"分享人ID"`
	ProductID          int64  `json:"productId" dc:"商品ID"`
	ProductNewID       int64  `json:"productNewId" dc:"新人商品ID"`
	MemberCardID       int64  `json:"memberCardId" dc:"会员卡ID"`
	JoinProductID      int64  `json:"joinProductId" dc:"关联的商品ID（会员订单用）"`
	Qty                uint   `json:"qty" v:"required#数量不能为空" dc:"数量"`
	Tel                string `json:"tel"  dc:"联系方式"`
	Recipient          string `json:"recipient"  dc:"收件人"`
	ShippingProvinceID int64  `json:"shippingProvinceId"  dc:"省市区ID"`
	ShippingAddress    string `json:"shippingAddress" dc:"详细地址"`
	AuctionLogId       uint64 `json:"auctionLogId" dc:"竞拍记录ID"`
	PointType          bool   `json:"pointType" dc:"权益支付类型，为true时为会员购买"`
	ReceiverAddressID  int64  `json:"receiverAddressId" dc:"收货地址ID"`
	RealName           string `json:"realName" dc:"真实姓名"`
	IdCard             string `json:"idCard" dc:"身份证号"`
}

func (in *OrderPayInp) Filter(ctx context.Context) (err error) {
	if len(in.Recipient) > 10 {
		err = gerror.New("收件人不能超过10个字符")
		return
	}
	if len(in.ShippingAddress) > 200 {
		err = gerror.New("详细地址不能超过200个字符")
		return
	}
	return
}

type OrderPayModel struct {
	AppId     string `json:"appId"`
	NonceStr  string `json:"nonceStr"`
	Package   string `json:"package"`
	SignType  string `json:"signType"`
	TimeStamp string `json:"timestamp"`
	PaySign   string `json:"paySign"`
}

type UserOrderStatus2ExpressedInp struct {
	OrderUID           string `json:"orderUID" v:"required#uid不能为空"  dc:"订单UUID"`
	ExpressCompany     int8   `json:"expressCompany" v:"required#物流公司代码不能为空"  dc:"物流公司代码"`
	ExpressNumber      string `json:"expressINumber" v:"required#快递单号不能为空"  dc:"快递单号"`
	Recipient          string `json:"recipient"  dc:"收件人"`
	ShippingProvinceID int64  `json:"shippingProvinceId"  dc:"省市区ID"`
	ShippingAddress    string `json:"shippingAddress" dc:"详细地址"`
}

func (in *UserOrderStatus2ExpressedInp) Filter(ctx context.Context) (err error) {
	if in.OrderUID == "" {
		err = gerror.New("uid不能为空")
		return
	}
	return
}

type UserOrderStatus2ExpressedModel struct{}

type UnPayOrderRePayInp struct {
	OrderUID string `json:"orderUID" v:"required#uid不能为空"  dc:"订单UUID"`
}

type RefundRequestInp struct {
	OrderUID string `json:"orderUID" v:"required#uid不能为空"  dc:"订单UUID"`
	Reason   string `json:"reason" v:"required#退款原因不能为空"  dc:"退款原因"`
}

func (in *RefundRequestInp) Filter(ctx context.Context) (err error) {
	return
}

type RefundRequestModel struct {
	entity.PayRefund
}

type AuctionOrderPayInp struct {
	ProductID    int64           `json:"productId" v:"required#商品ID不能为空" dc:"商品ID"`
	AuctionLogID uint64          `json:"auctionLogId" v:"required#竞拍记录ID不能为空" dc:"竞拍记录ID"`
	Amount       decimal.Decimal `json:"amount" v:"required#支付金额不能为空" dc:"支付金额"`
	Point        decimal.Decimal `json:"point" v:"required#支付积分不能为空" dc:"支付积分"`
	UserID       int64           `json:"userId" v:"required#用户ID不能为空" dc:"用户ID"`
}

type UserOrderDetailInp struct {
	UID        string  `json:"uid"     v:"required#uid不能为空"  dc:"订单UID"`
	Lng        float64 `json:"lng"     dc:"经度（114.038324）"`
	Lat        float64 `json:"lat"     dc:"纬度（22.656084）"`
	StoreOldId string  `json:"storeOldId"   dc:"旧门店ID"`
	StoreId    int64   `json:"storeId" dc:"门店ID"`
}

type UserOrderDetailModel struct {
	Id            int64       `json:"id"          orm:"id"           dc:"id"`
	Name          string      `json:"name"        orm:"name"         dc:"商品名称"`
	Uid           string      `json:"uid"         orm:"uid"          dc:"订单UUID"`
	OrderType     string      `json:"orderType"   orm:"order_type"   dc:"订单类型"`
	CreatedAt     *gtime.Time `json:"createdAt"   orm:"created_at"   dc:"创建时间"`
	Status        string      `json:"status"      orm:"status"       dc:"订单状态"`
	OpenId        string      `json:"openId"      orm:"open_id"      dc:"用户唯一标识"`
	Qty           uint        `json:"qty"         orm:"qty"          dc:"购买数量"`
	VerifiedCount uint        `json:"verified_count"  orm:"verified_count"   dc:"已核销次数"`
	UseAmount     float64     `json:"useAmount"   orm:"use_amount"   dc:"使用金额(RMB)"`
	Nickname      string      `json:"nickname"    orm:"nickname"     dc:"核销用户微信昵称"`
	Avatar        string      `json:"avatar"      orm:"avatar"       dc:"核销用户微信头像"`
	CanVerify     bool        `json:"canVerify"   orm:"can_verify"   dc:"能否核销"`
	Stores        []struct {
		Id            int64       `json:"id"            orm:"id"         dc:"ID"`
		Name          string      `json:"name"          orm:"name"       dc:"门店名称"`
		Address       string      `json:"address"       orm:"address"    dc:"门店地址"`
		Lat           float64     `json:"lat"           orm:"lat"        dc:"纬度"`
		Lng           float64     `json:"lng"           orm:"lng"        dc:"经度"`
		Phone         string      `json:"phone"         orm:"phone"      dc:"门店电话"`
		Distance      float64     `json:"distance"      orm:"distance"   dc:"距离(km)"`
		OldId         string      `json:"oldId"        orm:"old_id"      dc:"旧ID"`
		PublicityImgs *gjson.Json `json:"publicityImgs" orm:"publicity_imgs"         dc:"门店图片"`
		BusinessId    int64       `json:"businessId"      orm:"business_id"      dc:"商户ID"`
	} `json:"stores"      orm:"stores"      dc:"适用门店"`
}

type UserOrderVerifyInp struct {
	UID        string `json:"uid"  v:"required#订单UID不能为空"  dc:"订单UID"`
	Qty        uint   `json:"qty"  v:"required#核销数量不能为空"  dc:"核销数量"`
	StoreOldId string `json:"storeOldId"   dc:"旧门店ID"`
	StoreId    int64  `json:"storeId"  v:"required#门店ID不能为空"  dc:"门店ID"`
}

type UserOrderVerifyModel struct {
}

type UserOrderVerifiedCountInp struct {
	Id            int64 `json:"id" v:"required#id不能为空" dc:"id"`
	VerifiedCount int   `json:"verifiedCount" dc:"核销数量"`
}

type UserOrderVerifyCountInp struct {
	Id int64 `json:"id" dc:"id"`
}

type UserOrderVerifyCountModel struct {
	VerifiedCount      int `json:"verifiedCount" dc:"核销数量"`
	TodayVerifiedCount int `json:"todayVerifiedCount" dc:"当天订单核销数量"`
}
